
Last chance! 50% off unlimited learning
Sale ends in
Convert bn.fit
objects to grain
objects and vice versa.
# S3 method for grain
as.bn.fit(x, including.evidence = FALSE, ...)
# S3 method for bn.fit
as.grain(x)
# S3 method for grain
as.bn(x, ...)
An object of class grain
(for as.grain
), bn.fit
(for
as.bn.fit
) or bn
(for as.bn
).
an object of class grain(code)
(for as.bn.fit
) or
bn.fit()
(for as.grain
).
a boolean value. If FALSE
, the grain
object is converted without considering any evidence that has been set into
it. If TRUE
, any hard evidence is carried over into the bn.fit
object as a zero-one probability distribution.
extra arguments from the generic method (currently ignored).
Marco Scutari
if (FALSE) {
library(gRain)
a = bn.fit(hc(learning.test), learning.test)
b = as.grain(a)
c = as.bn.fit(b)}
Run the code above in your browser using DataLab